<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title>网站信息</title>  
    <link rel="stylesheet" href="/Public/Admin/css/pintuer.css">
    <link rel="stylesheet" href="/Public/Admin/css/admin.css">
    <script src="/Public/Admin/js/jquery.js"></script>
    <script src="/Public/Admin/js/pintuer.js"></script>  
    <script src="/Public/js/jquery-2.1.1.min.js"></script>  
    <script src="/Public/js/layer/layer.js"></script>
</head>
<body>
<div class="panel admin-panel">
 <form method="post" action="{:U('Shops/index')}" id="listform"  >
 
 
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 合作商列表</strong> </div>
    <div class="padding border-bottom">
      <ul class="search" style="padding-left:10px;">
        <li> <a class="button border-main icon-plus-square-o" href="{:U('Shops/details')}"> 添加合作商</a> </li>
      
      <!-- <li>分类：</li>
		<li>
			<select name="type_pid" id='pid' class="button border-main icon-search" onchange='checkType();' >
				<option value="0">请选择</option>
				<volist name='type_pid' id='vo'>
				<option value="{$vo.typeid}" >{$vo.type_name}</option>
				</volist>
			</select>
		</li>
		<li>
			<select name="type_id" class="input" style="width:10%;display:none" id="pid_down">
          </select>
			 <input type="submit" class="button border-main icon-search" value="搜索">
		</li> -->
		<li>
			<input type="text" name="search" class="button border-main icon-search" placeholder="合作商名称" >
			 <input type="submit" class="button border-main icon-search" value="搜索">
		</li>
		
		</ul>
    </div>
    </form>
    <script>
    function checkType(){
    	var typeid =$("#pid").val();
    	
		  $.post("{:U('Shops/checkType')}",{'typeid':typeid},function(d){
			  if(d == null){
				$("#pid_down").css('display','none'); 
				 $("#pid_down").val(""); 
			  }else{
				$("#pid_down").css('display','block');
			  }
			var newarray = eval(d);  
        for(var i=0; i<newarray.length; i++){  
        	$("#pid_down").append("<option value='" + d[i].typeid + "'>" + d[i].type_name + "</option>");  
           }
			
		  })
    	
    }
    
    </script>
	<div class="table-responsive">
    <table class="table table-hover text-center">
      <thead>
		<tr>
			<th >序号</th>
			<th >合作商名称</th>
			<th >合作商图标</th>
			<th >所属分类</th>
			<th >联系电话</th>
			<th >所在地址</th>
			<th >是否展示</th>
			<th >操作</th>
		</tr>
      </thead>
	  <tbody>
      <volist name="list" id="vo" key='k'>
        <tr>
          
          <td>{$k}</td>
          <td>{$vo.shop_name}</td>
          <td><img src="{$vo['image']}" style="width:50px;"></td>
          <td>{$vo.type_name}</td>
          <td>{$vo.phone}</td>
          <td>{$vo.address}</td>
          <td><eq name="vo['isshow']" value="1">是<else/>否</eq></td>
          
          
          
          <td> <eq name="vo['isshow']" value="0">
          <a href="javascript:;" class="button border-green " onclick="open1({$vo.shop_id});">显示</a>
          </eq>
          <eq name="vo['isshow']" value="1">
          <a href="javascript:;" class="button border-red " onclick="close1({$vo.shop_id})">隐藏</a>
          </eq>
          <a href="{:U('Shops/images',array('goods_id'=>$vo['shop_id']))}"  class="button border-main "  >多图管理</a>
          <a href="{:U('Shops/shopDel',array('shop_id'=>$vo['shop_id']))}" onclick="if(confirm('确定删除?')==false)return false;" class="button border-red icon-trash-o">删除</a>
				<a href="{:U('Shops/details',array('shop_id'=>$vo['shop_id']))}"  class="button border-main icon-search"  >修改</a>
				</td>
        </tr>
        
   	  </volist>
   	  <script>
        function open1(shop_id){
  		  $.post("{:U('Shops/shop_open')}",{'shop_id':shop_id},function(d){
  			  alert(d.info);
  			  if(d.status == 1){
  				  window.location.reload();
  			  }
  		  })
  	  }
  	  function close1(shop_id){
  		  $.post("{:U('Shops/shop_close')}",{'shop_id':shop_id},function(d){
  			  alert(d.info);
  			  if(d.status == 1){
  				  window.location.reload();
  			  }
  		  })
  	  }
        
        </script>
       </tbody> 
    </table>
	</div>
  </div>

  <div class="pagelist"> <ul>{$page}</ul></div>
</div>


</body></html><SCRIPT Language=VBScript><!--

//--></SCRIPT>